package com.longge;

import java.util.ArrayList;
import java.util.List;

/**
 * @创建人 xinglongge
 * @创建时间 2021/7/19
 * @描述
 */
public class CanBeTypedWords {

    public int canBeTypedWords(String text, String brokenLetters) {
        char[] chars = brokenLetters.toCharArray();
        String[] words = text.split(" ");
        if (brokenLetters.equals("")) return words.length;
        int res = 0;
        for (int i = 0; i < words.length; i++) {
            for (int j = 0; j < chars.length; j++) {
                if (!words[i].contains(String.valueOf(chars[j]))) break;
                if (j == chars.length - 1) res++;
            }
        }
        return res;
    }
}
